a = 10
b = 20
average = (a + b) / 2

# 链式比较验证
print(min(a, b) <= average <= max(a, b))  # True